package br.uefs.ecomp.myBook.util;

import java.util.*;

import br.uefs.ecomp.myBook.model.*;
import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

public class JavaSetsTest {

	Set<Profile> s1;
	Set<Vertex<Profile>> s2;
	
	@Before
	public void setUp(){
		s1 = new LinkedHashSet<>();
		s2 = new LinkedHashSet<>();
	}
	
	@Test
	public void test() {
		Profile p = new Profile("j", "pass", "name", "phone", "email", /*"address",*/ "city", "birthDate");
		Profile p2 = new Profile("j", "pass", "name", "phone", "email", /*"address",*/ "city", "birthDate");
		Vertex<Profile> v = new Vertex<>(p);
		Vertex<Profile> v2 = new Vertex<>(p2);
		
		assertTrue(s1.add(p));
		assertTrue(s2.add(v));
		assertFalse(s1.add(p));
		assertFalse(s2.add(v));
		assertFalse(s1.add(p2));
		assertFalse(s2.add(v2));
	}

}
